 class Animal {
   // public final String name = "123";//姓名
    public  String name = "123";//姓名
    public int age;

    static {
        System.out.println("Animal static{}");
    }

    {
        System.out.println("Animal {}");
    }

    public Animal() {
        System.out.println("Animal()");
    }
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("带有2个参数的构造方法！");
    }
    public void eat() {
        System.out.println(name+" 正在吃饭！");
    }
}
class Dog1 extends Animal {
    static {
        System.out.println("Dog static{}");
    }

    {
        System.out.println("Dog {}");
    }
    public Dog1() {
        //super();//编译器会帮你默认加上的
        System.out.println("DOG()");
    }

    public Dog1(String name,int age) {
        //super();
        super(name,age);
        /*name = "ffa";
        age = 10;
        */
        //super("七月",10);//显示的调用父类的构造方法，帮助父类的成员进行初始化
    }

    public void wangwang() {
        System.out.println(name +" 旺旺叫！");
    }
}
class Cat extends Animal {

    public Cat() {

    }

    public int size;
    public Cat(String name,int age,int size) {
        super(name,age);
        this.size = size;
    }
    public Cat(String name,int age) {
        super(name,age);
        //this("1",2,3);
    }

    public void mew() {
        System.out.println(name +" 正在喵喵叫！");
    }
}

public class Test {
    public static void main(String[] args) {
         final int A = 10;
         //A = 100;
        System.out.println(A);
    }
    public static void main2(String[] args) {
        Dog dog = new Dog();
        System.out.println("=====");
        Dog dog2 = new Dog();


    }
    public static void main1(String[] args) {
        Dog1 dog = new Dog1();
        dog.name = "坦克";
        dog.wangwang();
        dog.eat();
        System.out.println("==============");
        Cat cat = new Cat();
        cat.name = "咪咪";
        cat.mew();
        cat.eat();
    }
}